home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1989 Special Issue
/
rerun-1989-special-issue.d64
/
show of hands
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
6KB
|
209 lines
100 rem* a show of hands *
110 rem* an sign language alphabet learning program *
120 rem* by jack r. farrah 11/87 *
130 poke55,255:poke56,116:rem lower top of basic memory below ml and pic file
140 print"[147]"spc(10)"loading picture file"
150 if a=0 then a=1:load"picture file",8,1
160 clr:rem set top of string variables to top of basic
170 print"[147]"spc(9)"installing ml routines"
180 ml=29952:rem start address of ml routines
190 for x=1 to 412
200 read a:sum=sum+a:next
210 if sum<>54225 then print "checksum error!":stop
220 restore
230 for x=1 to 412
240 read a:poke ml,a:ml=ml+1:next
250 dim a(25):rem 26 element alphabet array
260 print"[147]"spc(12)"a show of hands":print
270 printspc(6)"the american manual alphabet":print:print
280 printspc(11)"(1) signs test":print
290 printspc(11)"(2) text to signs":print
300 printspc(11)"(3) quit program":print
310 printspc(12):input"select(1-3)";a$
320 if a$="1"then 360
330 if a$="2"then 940
340 if a$="3"then end
350 goto 310
360 rem *signs test routine*
370 print"[147]"spc(15)"signs test":print
380 printspc(7)"(1) time limit per letter":print
390 printspc(7)"(2) no time limit":print
400 printspc(7)"(3) return to main menu":print
410 tflag=0:rem flag to show if timing required
420 printspc(12):input"select(1-3)";a$
430 if a$="1"then 460
440 if a$="2"then 520
450 if a$="3"then 260
460 rem* time limit test *
470 print:printspc(10)"1=fastest 9=slowest"
480 printspc(10):input"select speed(1-9) ";a$
490 a=10*(val(a$)):d=a:if a$<"1" or a$>"9" then 480
500 tflag=1:rem show time loop required
510 rem*no time limit routine starts*
520 rem*fill array with ascii codes for letters*
530 l=65
540 for x=0 to 25
550 a(x)=l
560 l=l+1
570 next
580 sys 30079:rem clear bit map
590 sys 29952:rem switch in raster interrupt
600 n=rnd(-ti):rem set up for new random sequence
610 n=rnd(1)*(25-0)+0:rem random # from 0 to 25
620 if a(n)=0 then print:print"wait...":goto 830
630 b=a(n):c=n:poke780,b:rem save # in b and array element in c
640 sys 30128:rem display sign
650 print"[147]":poke214,21:print"press key of sign's letter."
660 get a$
670 if a$=""and tflag=1 then 760:rem do timing loop if flag set
680 if a$=""goto 660
690 if a$=chr$(b) then print:print"correct!":a(c)=0:a=d:wait203,64:goto 710
700 print:print"sorry. this sign is for the letter "chr$(b)"[146]":a=d
710 print"hit c to continue, m for menu":wait203,64
720 get a$:if a$="" then 720
730 if a$="c" then 610
740 if a$="m" then sys 30272:goto 360:rem reset to normal interrupt
750 goto 720
760 rem*timing loop*
770 for y=1 to 25:next y
780 a=a-1
790 if a>0 then 660
800 if a=0 then print"time expired!"
810 print"this sign is for the letter "chr$(b)"[146]":a=d:rem reset delay value
820 goto 710
830 rem* array element found to be 0*
840 rem*check if all elements used*
850 x=0
860 e=a(x)
870 if e<>0 then n=x:goto 630:rem take next non-zero element
880 x=x+1:if x=26 then 900
890 goto 860
900 print"excellent! you have completed the"spc(7)"alphabet of signs."
910 print"hit any key to return to menu."
920 get a$:if a$="" then 920
930 a$="m":goto 740
940 rem*text to signs routine*
950 print"[147]"spc(13)"text to signs":print:print
960 printspc(3)"(1) show letters as entered":print
970 printspc(3)"(2) enter text string for display":print
980 printspc(3)"(3) return to main menu":print
990 printspc(12):input"select (1-3) ";a$
1000 if a$="1" then print:poke214,21:print:sys 30079:sys 29952:goto 1040
1010 if a$="2" then 1120
1020 if a$="3" then 260
1030 goto 990
1040 rem*show letters as entered routine*
1050 print:print"enter letters a-z."
1060 print"any other keys return to menu."
1070 get a$:if a$="" then 1070
1080 if a$<"a" or a$>"z" then sys 30272:goto 950
1090 b=asc(a$):print a$
1100 poke780,b:sys 30128:rem display sign
1110 goto 1070
1120 rem*enter text string routine*
1130 print"[147]"spc(9)"display text strings":print
1140 printspc(4)"maximum length of text string is"
1150 printspc(12)"255 characters.":print
1160 print"only letters (a-z) and spaces recognized"
1170 printspc(6)"display time per character "
1180 printspc(5)"can be varied for practicing."
1190 print:printspc(13)"1=fast 9=slow"
1200 print:printspc(10):input"select speed (1-9) ";a$
1210 if val(a$)<1 or val(a$)>9 then 1200
1220 b=val(a$)
1230 print:poke214,21:print:sys 30079:sys 29952
1240 print"enter text string."
1250 gosub 1550
1260 print:c=len(a$)
1270 if c>0 then 1330
1280 print"hit c to continue, m to return to menu"
1290 get a$:if a$="" then 1290
1300 if a$<>"c" or a$<>"m" then 1280
1310 if a$="m" then sys 30272:goto 950
1320 goto 1240
1330 for x=1 to c
1340 d$=mid$(a$,x,1)
1350 d=asc(d$)
1360 if d=32 then print" ";:goto 1410:rem ignore space but print it
1370 if d<65 or d>90 then print"?";:goto 1410
1380 poke780,d:sys 30128:rem display sign
1390 print d$;
1400 gosub 1490:rem do timing loop
1410 next x
1420 rem*string has now been displayed*
1430 print:printspc(5)"hit c to enter another string"
1440 printspc(10)"m to return to menu"
1450 get a$:if a$="" then 1450
1460 if a$<>"c" and a$<>"m" then 1430
1470 if a$="c" then 1240
1480 sys 30272:goto 950
1490 rem*timing subroutine b=timing value*
1500 for y=1 to b
1510 for z=1 to 100:next z
1520 next y
1530 return
1540 rem* input text string routine *
1550 y=0:a$=""
1560 get b$
1570 poke204,0:rem blink cursor
1580 if b$="" then 1560
1590 if b$=chr$(13) then poke204,1:return
1600 if b$=chr$(20) and y>1 then a$=mid$(a$,1,y-1):print b$;:y=y-1:goto 1560
1610 if b$=chr$(20) and y=0 then goto 1560
1620 print b$;:a$=a$+b$:y=y+1
1630 if y=255 then poke 204,0:print:print"max string length!":print:return
1640 goto 1560
1650 rem* data for ml routines *
1660 data 120,169,127,141,13,220,169,1
1670 data 141,26,208,169,217,141,18,208
1680 data 169,24,141,17,208,169,0,141
1690 data 173,117,173,0,221,141,174,117
1700 data 173,24,208,141,175,117,169,50
1710 data 141,20,3,169,117,141,21,3
1720 data 88,96,169,15,141,25,208,173
1730 data 173,117,240,34,173,17,208,9
1740 data 32,141,17,208,169,217,141,18
1750 data 208,173,0,221,41,252,141,0
1760 data 221,169,8,141,24,208,169,0
1770 data 141,173,117,76,49,234,169,27
1780 data 141,17,208,173,175,117,141,24
1790 data 208,173,174,117,141,0,221,169
1800 data 49,141,18,208,169,1,141,173
1810 data 117,104,168,104,170,104,64,162
1820 data 0,169,1,157,0,192,157,250
1830 data 192,157,244,193,157,238,194,232
1840 data 224,250,208,239,169,0,133,251
1850 data 169,224,133,252,169,0,168,145
1860 data 251,200,208,251,230,252,166,252
1870 data 224,255,208,243,96,0,0,0
1880 data 233,65,10,170,189,104,118,133
1890 data 251,189,105,118,133,252,169,228
1900 data 133,254,169,40,133,253,169,0
1910 data 141,61,118,141,60,118,168,170
1920 data 140,61,118,172,60,118,177,251
1930 data 201,254,240,16,200,32,22,118
1940 data 140,60,118,172,61,118,32,29
1950 data 118,76,208,117,200,32,22,118
1960 data 177,251,141,62,118,200,32,22
1970 data 118,177,251,141,63,118,200,32
1980 data 22,118,140,60,118,172,61,118
1990 data 173,62,118,32,29,118,206,63
2000 data 118,208,245,76,208,117,192,0
2010 data 208,2,230,252,96,145,253,200
2020 data 192,112,208,20,160,0,232,224
2030 data 16,240,14,169,64,24,101,253
2040 data 133,253,144,2,230,254,230,254
2050 data 96,104,104,96,0,0,0,0
2060 data 120,169,129,141,13,220,169,0
2070 data 141,26,208,169,155,141,17,208
2080 data 173,174,117,141,0,221,173,175
2090 data 117,141,24,208,169,49,141,20
2100 data 3,169,234,141,21,3,88,96
2110 data 174,119,11,121,144,122,253,123
2120 data 168,125,252,126,158,128,6,130
2130 data 63,131,179,132,93,135,234,136
2140 data 133,138,2,140,132,141,20,143
2150 data 197,144,81,146,204,147,243,148
2160 data 58,150,202,151,130,153,75,155
2170 data 202,156,70,158